﻿<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head lang="en" th:replace="main/public :: #public_Head">
<!--    <meta charset="UTF-8">-->
<!--    <title>账单管理系统</title>-->
<!--    <link rel="stylesheet" href="../css/public.css"/>-->
<!--    <link rel="stylesheet" href="../css/style.css"/>-->
</head>
<body>
<!--头部-->
    <header class="publicHeader" th:replace="main/public :: #public_Header">
<!--        <h1>账单管理系统</h1>-->
<!--        <div class="publicHeaderR">-->
<!--            <p><span>下午好！</span><span style="color: #fff21b"> Admin</span> , 欢迎你！</p>-->
<!--            <a href="login.html">退出</a>-->
<!--        </div>-->
    </header>
<!--时间-->
    <section class="publicTime" th:replace="main/public :: #public_Time">
<!--        <span id="time">2028年1月1日 11:11  星期一</span>-->
<!--        <a href="#">温馨提示：为了能正常浏览，请使用高版本浏览器！（IE10+）</a>-->
    </section>
<!--主体内容-->
    <section class="publicMian ">
        <div class="left" th:replace="main/public :: #public_Left(activeUri='pwd')">
<!--            <h2 class="leftH2"><span class="span1"></span>功能列表 <span></span></h2>-->
<!--		<nav>-->
<!--            <ul class="list">-->
<!--                <li ><a href="../bill/list.html">账单管理</a></li>-->
<!--                <li><a href="../provider/list.html">供应商管理</a></li>-->
<!--                <li><a href="../user/list.html">用户管理</a></li>-->
<!--                <li id="active"><a href="../main/password.html" >密码修改</a></li>-->
<!--                <li><a href="../main/login.html">退出系统</a></li>-->
<!--            </ul>-->
<!--        </nav>-->
        </div>
        <div class="right">
            <div class="location">
                <strong>你现在所在的位置是:</strong>
                <span>密码修改页面</span>
            </div>
            <div class="providerAdd">
                <div th:text="${msg}" th:if="${not #strings.isEmpty(msg)}" style="color:red; margin-left: 130px">用户名错 误！</div>
                <form id="pwdForm" th:action="@{/usermm}" action="#"  th:method="post">
                    <!--div的class 为error是验证错误，ok是验证成功-->

<!--                    <input th:type="hidden" name="id" th:value="${userByBid.id}">-->
                    <div class="">
                        <label for="username">用户名：</label>
                        <input type="username"  id="username" name="username"/>
                        <span id="nameText">*请输用户名</span>
                    </div>
                    <div class="">
                        <label for="oldPassword">旧密码：</label>
                        <input type="password" name="oldPassword" id="oldPassword" autofocus="autofocus" required/>
                        <span id="pwdText">*请输入原密码</span>
                    </div>
                    <div>
                        <label for="newPassword">新密码：</label>
                        <input type="password" name="newPassword" id="newPassword" required/>
                        <span id="newPwdText">*请输入新密码</span>
                    </div>
                    <div>
                        <label for="confirmPassword">确认新密码:</label>
                        <input type="password" id="confirmPassword" name="confirmPassword" required>
                        <span id="reNewPwdText" >*请输入新确认密码，保证和新密码一致</span>
                    </div>
                    <div class="providerAddBtn">
                        <!--<a href="#">保存</a>-->
                        <input type="submit" onclick="$('#pwdForm').submit()" value="保存" id="save"/>
                    </div>
                </form>
            </div>
        </div>
    </section>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
<script>

    // 发送请求
    // 例如，使用 AJAX 请求
    $("#save").click(function () {
        event.preventDefault();
        $.ajax({
            url: "/usermm",
            type: "POST",
            data:{username: $("#username").val(),
                oldPassword: $("#oldPassword").val(),
                newPassword: $("#newPassword").val(),
                confirmPassword: $("#confirmPassword").val()

        }
        });
    });
</script>
<footer class="footer" th:replace="main/public :: #public_Footer"><div style="text-align:center;"></div></footer>
<script src="../js/jquery.js"></script>
<script src="js/time.js"></script>

</body>
</html>